//
//  DTDeviceNotifaction.m
//  PersonalManager
//
//  Created by user on 16/8/1.
//  Copyright © 2016年 Haiyun.Qian. All rights reserved.
//

#import "DTDeviceNotifaction.h"
#import "DTDeviceAlert.h"

@implementation DTDeviceNotifaction

-(instancetype)init {
    self = [super init];
    return self;
}

//提示框
-(void) confirm:(DTJavascriptCommand *)command {
    self.alert = [[DTDeviceAlert alloc]init:command];
    command.actionObject = self.alert;
    [self.alert confirm];
}

//actionsheet
-(void)actionSheet:(DTJavascriptCommand *)command {
    
    self.alert = [[DTDeviceAlert alloc]init:command];
    command.actionObject = self.alert;
    [self.alert show];
}

//输入提示框
-(void) prompt:(DTJavascriptCommand *)command {
    self.alert = [[DTDeviceAlert alloc]init:command];
    command.actionObject = self.alert;
    [self.alert prompt];
}

//震动
-(void) vibrate: (DTJavascriptCommand *)command {
    self.alert = [[DTDeviceAlert alloc]init:command];
    command.actionObject = self.alert;
    [self.alert vibrate];
}

//显示加载动画
-(void)showPreloader:(DTJavascriptCommand *)command{
    self.alert = [[DTDeviceAlert alloc]init:command];
    command.actionObject = self.alert;
    [self.alert showPreloader];
}

//停止加载动画
-(void)hidePreloader:(DTJavascriptCommand *)command{
    self.alert.command = command;
    command.actionObject = self.alert;
    [self.alert hidePreloader];
}

@end
